<?php
  require('note.class.php');
  //Doi tuong Sitemap cho phep ban tao mot Sitemap voi cac Note.
	class Sitemap extends Note {
		var $objnote = array(); //Danh sach Note cua SiteMap

		//Constructor Sitemap
		function Sitemap() {
		}
		//Add mot Note vao sitemap
		function setObjNote($note) {
			if($note != "") {
				$n = count($this->objnote);
				$this->objnote[$n] = $note;
			}
		}
		//Tao va Add mote Note vao SiteMap
		function setNote($label, $link, $level, $class, $idkey) {
			if($label != "") {
				$n = count($this->objnote);
				$this->objnote[$n] = new Note();
				$this->objnote[$n]->setItem($label, $link, $level, $class, $idkey);
			}
		}
		//Tao va Add danh sach Note vao Sitemap
		function setListObjNote($list) {
			if(is_array($list)) {
				$n = count($this->objnote);
				$jj = 0;
				for($ii = $n; $ii < $n + count($list); $ii++) {
					$k = 0;
					$this->objnote[$ii] = new Note();
					$this->objnote[$ii]->setItem($list[$jj][$k++], $list[$jj][$k++], $list[$jj][$k++], $list[$jj][$k++], $list[$jj][$k++]);
					$jj++;
				}
			}
		}
		//Ham nay tao va tra ve Sitemap.
		function getSiteMap() {
			$return = "";
			for($ii = 0; $ii < count($this->objnote); $ii++) {
				$return .= $this->objnote[$ii]->getNote();
			}
			return $return;
		}
	}
?>
